<fieldset class="layui-elem-field layui-field-title" >
    <legend><?echo $l_xitong_gaikuang?></legend>
</fieldset>



<ul class="indexinfo">

    <!--订单信息
    <li>
        <div class="box">
            <h6><i class="fa fa-bar-chart-o" aria-hidden="true"></i><?echo $l_dingdan_xinxi?></h6>
            <hr class="layui-bg-green">
            <div class="content">

                <?
                $p['array']=$orderlist;
                $p['condition_key']="status";
                $p['condition_value']="待确认";
                $p['target']='price';
                $result=sum_with_key_by_value_in_2d_array($p);
                ?>
                <div><b><?echo $l_dengdai_queren;?>：</b> <?echo $result['num']?> 单 / <?echo $result['sum']?>元</div>

                <?$p['condition_value']="待发货";$result=sum_with_key_by_value_in_2d_array($p)?>
                <div><b><?echo $l_dengdai_fahuo?>：</b> <?echo $result['num']?> 单 / <?echo $result['sum']?>元</div>

                <?$p['condition_value']="已发货";$result=sum_with_key_by_value_in_2d_array($p)?>
                <div><b><?echo $l_yijing_fahuo?>：</b> <?echo $result['num']?> 单 / <?echo $result['sum']?>元</div>

                <?$p['condition_value']="待收款";$result=sum_with_key_by_value_in_2d_array($p)?>
                <div><b><?echo $l_dengdai_shoukuan?>：</b> <?echo $result['num']?> 单 / <?echo $result['sum']?>元</div>

                <?$p['condition_value']="已完成";$result=sum_with_key_by_value_in_2d_array($p)?>
                <div><b><?echo $l_yijing_wancheng?>：</b> <?echo $result['num']?> 单 / <?echo $result['sum']?>元</div>
            </div>
        </div>
    </li>
-->






<!--                // TODO 后期应该做到动态告急，根据产品销售情况，不能够支撑一定天数的消耗，就提示告急-->

<!--
    <li>
        <div class="box">
            <h6><i class="layui-icon layui-icon-component"></i> <?echo $l_chanpin_gaikuang?></h6>
            <hr class="layui-bg-green">
            <div  class="content">
                <? $product_num=count_by_item($table_prefix."product","");?>
                <? $product_on=count_by_item($table_prefix."product","status = '正常'");?>
                <? $product_empty=count_by_item($table_prefix."product","storage = 0 ");?>
                <? $product_less=count_by_item($table_prefix."product","storage < 10");?>
                <div><b><?echo $l_chanpin_zongshu?>：</b><? echo $product_num ?> </div>
                <div><b><?echo $l_shangjia_chanpin?>：</b><? echo $product_on ?> </div>
                <div><b><?echo $l_kucun_weikong?>：</b><? echo $product_empty ?> </div>
                <div><b><?echo $l_kucun_yujing?>：</b><? echo $product_less ?> </div>
            </div>

        </div>
    </li>
-->


    <!--用户概况-->
    <li>
        <div class="box">
            <h6><i class="layui-icon">&#xe653;</i><?echo $l_yonghu_gaikuang?></h6>
            <hr class="layui-bg-green">
            <div  class="content">
                <? $all_member=count_by_item($table_prefix."member","nid > 0");?>

                <? $order_member=count_by_item($table_prefix."orderlist","nid > 0 group by member_nid");?>

<!--                <div><b>--><?//echo $l_xiadan_yonghu?><!--：</b>--><?// echo $order_member ?><!-- </div>-->
                <div><b>超时联系人：</b><? echo $all_member ?> </div>
                <div><b>超时用户：</b><? echo $all_member ?> </div>
                <div><b><?echo $l_suoyou_yonghu?>：</b><? echo $all_member ?> </div>
                <div><b>联系人总数：</b><? echo $all_member ?> </div>

            </div>

        </div>
    </li>






    <!--最新信息-->
    <li>
        <div class="box">
            <h6><i class="layui-icon">&#xe7ae;</i><?echo $l_zuixin_xiaoxi?></h6>
            <hr class="layui-bg-green">
            <div  class="content">
                <div>1.系统当前汇率 1:88，参考汇率1:100</div>
            </div>

        </div>
    </li>








    <!-- // TODO 这部分的统计范围应该取一个时间段。
    //上个月的话，数据太长时间部变，
    //这个月的话，从0开始，数据量不大。
    //统计上一周，数据量也不大。
    //统计最近50天如何？-----------------------暂时偏向这个
    //从头统计起又太吃资源了。



    <li>
        <div class="box">
            <?
            $p['orderby']="sums";
            $p['sum']="number";
            $p['count']="product_nid";
            $p['table']=$table_prefix."order_detail";
            $p['groupby']="product_nid";
            $p['orderby']="sums";
            $p['orders']="desc";
            $p['limit']="5";
            $p['log']="0";
            $list=count_sum_groupby($p);

            ?>
            <h6><i class="fa fa-shopping-cart" aria-hidden="true"></i>销量排行</h6>
            <hr class="layui-bg-green">
            <ol  class="content">
                <? foreach ($list as $k => $v) {?>
                    <li><?echo $k+1 ?> : <?echo $v['name']?>  <span style="float: right"><?echo $v['sums']?></span>  </li>
                    <?;}?>
            </ol>

        </div>
    </li>




    <li>
        <div class="box">
            <?
            $p['orderby']="sums";
            $p['sum']="price";
            $p['count']="product_nid";
            $p['table']=$table_prefix."order_detail";
            $p['groupby']="product_nid";
            $p['orderby']="sums";
            $p['orders']="desc";
            $p['limit']="5";
            $p['log']="0";
            $list_price=count_sum_groupby($p);

            ?>
            <h6><i class="fa fa-dollar" aria-hidden="true"></i>销售额排行</h6>
            <hr class="layui-bg-green">
            <ol  class="content">
                <? foreach ($list_price as $k => $v) {?>
                    <li><?echo $k+1 ?> : <?echo $v['name']?>  <span style="float: right"><?echo $v['sums']?></span>  </li>
                    <?;}?>
            </ol>

        </div>
    </li>

 -->






    <!--// TODO 后期应该做到动态告急，根据产品销售情况，不能够支撑一定天数的消耗，就提示告急-->
    <!--销售排行-->
    <li>
        <div class="box">
            <?
            $p['orderby']="sums";
            $p['sum']="price";
            $p['count']="nid";
            $p['table']=$table_prefix."order_list";
            $p['groupby']="agent";
            $p['orderby']="sums";
            $p['orders']="desc";
            $p['limit']="5";
            $p['log']="0";
            $list_agent=count_sum_groupby($p);

            $emp_rank_array=transform_2darray_in_1darray_number_as_key($list_agent,"agent");
            $emp_rank_str=implode($emp_rank_array,"','");

            $emp_rank=select_lines_items($table_prefix."employee","","name,nid","nid in ('".$emp_rank_str."')","");
            $emp_list=transform_2darray_in_1darray_with_new_key($emp_rank,"nid","name");


            ?>
            <h6><i class="layui-icon">&#xe626;</i>销售排行</h6>
            <hr class="layui-bg-green">
            <ol  class="content">
                <? foreach ($list_agent as $k => $v) {?>
                    <li><a href="../../employee/view/detail-statistic.php?now_extender=employee&nid=<?echo $v['agent']?>" > <?echo $k+1 ?> : <?echo $emp_list[$v['agent']]?> </a>  <span style="float: right"><?echo $v['sums']?></span> </li>
                    <?;}?>
            </ol>

        </div>
    </li>






<!--    <li>-->
<!--        <div class="box">-->
<!--            <h6><i class="fa fa-map-o" aria-hidden="true"></i>地区分布</h6>-->
<!--            <hr class="layui-bg-green">-->
<!--            <div  class="content">-->
<!--                <div  class="content">-->
<!--                    <div>暂无数据...</div>-->
<!--                </div>-->
<!--            </div>-->
<!---->
<!--        </div>-->
<!--    </li>-->
<!---->








    <!--    -->
<!---->
<!--    <li>-->
<!--        <div class="box">-->
<!--            <h6><i class="layui-icon">&#xe7ae;</i>续费信息</h6>-->
<!--            <hr class="layui-bg-green">-->
<!--            <div  class="content">-->
<!--                <b>服务器续费</b>：--><?//echo $site['hostexpire']?><!--<br/>-->
<!--                <b>服务器续费倒数</b>：--><?// echo count_days(date("Y-m-d"),$site['hostexpire'])?><!--日<br/><br/>-->
<!--                <p class="single-ellipsis" style="width: 90%;float: left"><b>域名</b>:--><?//echo $site['domin']?><!--</p><br/>-->
<!--                <b>域名续费</b>：--><?//echo $site['dominexpire']?><!--<br/>-->
<!--                <b>域名续费倒数</b>：--><?// echo count_days(date("Y-m-d"),$site['dominexpire'])?><!--日<br/>-->
<!--            </div>-->
<!--        </div>-->
<!--    </li>-->
<!---->
<!---->
<!---->
<!--    <li>-->
<!--        <div class="box"><h6><i class="layui-icon">&#xe7ae;</i> 系统信息</h6><hr class="layui-bg-green">-->
<!--            <div  class="content">-->
<!--                <b>服务器开通时间</b>：--><?//echo $site['hoststart']?><!--<br/>-->
<!--                <b>运行天数</b>：--><?// echo count_days($site['hoststart'],date("Y-m-d"))?><!--<br/>-->
<!--            </div>-->
<!--        </div>-->
<!--    </li>-->
<!---->
<!---->
<!---->
<!--    <li>-->
<!--        <div class="box">-->
<!--            <h6><i class="layui-icon">&#xe7ae;</i> 服务器</h6><hr class="layui-bg-green">-->
<!--            <div  class="content">-->
<!---->
<!--                <b>使用空间</b>：-->
<!--                <a href="javascript:;" onclick="show_message_box('product','365')">-->
<!--                    --><?// $suerage=getDirSize("../uploadfiles/".$theme_folder);
//                    if($userage<1073741824){echo "<span class='layui-badge layui-bg-green'>非常好</span>";}
//                    elseif($userage>3239225472){echo "<span class='layui-badge layui-bg-orange'>空间紧张</span>";}
//                    ?>
<!--                </a>-->
<!--                <br class="--><?//echo trans_storage_unit($suerage)?><!--"/>-->
<!--            </div>-->
<!--        </div>-->
<!--    </li>-->



</ul>
